package edu.indiana.d2i.ontology.exec;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.hp.hpl.jena.ontology.DatatypeProperty;
import com.hp.hpl.jena.ontology.ObjectProperty;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;

import edu.indiana.d2i.ontology.AbstractSQLExec;
import edu.indiana.d2i.ontology.util.AccessDBUtil;
import edu.indiana.d2i.ontology.util.Constants;

public class GCover extends PInfo {
	private final String prefix = "goundcover_";
	private final String SQLPREFIX = "select * from P_GCOVER where ID=";

	public GCover(AccessDBUtil dbCon, OntModel model, int id, String subjectURI) {
		super(dbCon, model, id, subjectURI);
		resourceURI = nameSpace + prefix + id; 		// set the URI for the resource
		sqlStatement = SQLPREFIX + id;				// 
		individual = 								// create individual (instance)
			model.getOntClass(Constants.GCOVER_CLASS).createIndividual(resourceURI);
	}
	
	@Override
	protected void addDataProperties(String sql) {		
		super.addDataProperties(sql);
		
		String sqlStatement = "SELECT * FROM f_organ fo where fo.id=" + organID;
		super.addDataProperties(sqlStatement);
	}

	@Override
	protected void addObjectProperties(String subjectURI) {
		super.addObjectProperties(subjectURI);
	}
	
	@Override
	public void setData2JenaModel() {
		assert sqlStatement != null;
		
		// add data properties				
		this.addDataProperties(sqlStatement);
		
		// add object properties
		this.addObjectProperties(subjectURI);
	}
}
